package com.jinboe.comm.vo;

import java.util.List;

public class CommPage {
	
	private List<Object> commList;
	private int pageNo;
	private int pageSize;
	private int noteCount;
	private int pageCount;
	private int noteStart;
	private int noteEnd;
	public CommPage(){
		pageNo=1;
		pageSize=10;
	}
	public void setNoteCount(int noteCount) {		
		this.noteCount = noteCount;
		if((noteCount%pageSize)==0){
			pageCount=noteCount/pageSize;
		}else{
			pageCount=noteCount/pageSize+1;
		}
		if(pageNo>pageCount){
			pageNo=pageCount;
		}else if(pageNo==0){
			pageNo=1;
		}
		this.noteStart=(pageNo-1)*pageSize+1;
		this.noteEnd=noteStart+pageSize;
	}
	
	public int getNoteStart() {
		return noteStart;
	}
	public void setNoteStart(int noteStart) {
		this.noteStart = noteStart;
	}
	public int getNoteEnd() {
		return noteEnd;
	}
	public void setNoteEnd(int noteEnd) {
		this.noteEnd = noteEnd;
	}
	public List<Object> getCommList() {
		return commList;
	}
	public void setCommList(List commList) {
		this.commList = commList;
	}
	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	
	public int getNoteCount() {
		return noteCount;
	}
	
	public int getPageCount() {
		return pageCount;
	}
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}
	
}
